const Koa = require('koa')
const body = require('koa-better-body')
const convert = require('koa-convert')

const server = new Koa()

server.listen(9090)

server.use(convert(body({
    uploadDir: './upload/',
    keepExtensions: true
})))

server.use(async (ctx, next) => {
    console.log('fields', ctx.request.fields)
    ctx.cookies.set('user', {expires: 24 * 3600 * 1000, path: '/', domain: ''} )
})
